package test;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2021-04-23
 * Time: 15:07
 */
abstract class Vehicle {
    protected String name;
    protected int numberOfWheels;
    protected int currentSpeed;
    protected int maxSpeed;

    public Vehicle(String name, int numberOfWheels, int maxSpeed) {
        this.name = name;
        this.numberOfWheels = numberOfWheels;
        this.maxSpeed = maxSpeed;
    }

    @Override
    public String toString() {
        String message = getClass().getSimpleName() + "(" + numberOfWheels + " wheels),\n";
        message += getName() + "(speed=" + currentSpeed + ")";

        return message;
    }

    public abstract void accelerate();

    public abstract void decelerate();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getNumberOfWheels() {
        return numberOfWheels;
    }

    public void setNumberOfWheels(int numberOfWheels) {
        this.numberOfWheels = numberOfWheels;
    }

    public int getCurrentSpeed() {
        return currentSpeed;
    }

    public void setCurrentSpeed(int currentSpeed) {
        this.currentSpeed = currentSpeed;
    }

    public int getMaxSpeed() {
        return maxSpeed;
    }

    public void setMaxSpeed(int maxSpeed) {
        this.maxSpeed = maxSpeed;
    }
}
